.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.stack 200
.data
__error_resta db "RESULTADO NEGATIVO EN RESTA", 0
__error_overflow db "OVERFLOW EN PRODUCTO", 0
__error db "ERROR", 0
_b dd ?
_a dd ?
_ELSE db "ELSE", 0
_1ul dd 1
_IF db "IF", 0
_3ul dd 3
.code
start:
MOV ebx, _1ul
MOV _a, ebx
@Label3:
MOV ebx, _a
CMP ebx, _3ul
JGE @Label24
MOV ebx, _a
ADD ebx, _1ul
MOV ecx, _a
CMP ecx, _b
JGE @Label20
invoke MessageBox, NULL, addr _IF, addr _IF, MB_OK
JMP @Label22
@Label20:
invoke MessageBox, NULL, addr _ELSE, addr _ELSE, MB_OK
@Label22:
JMP @Label3
@Label24:
jmp fin
overflow:
invoke MessageBox, NULL, addr __error_overflow, addr __error, MB_OK
invoke ExitProcess, 0
res_negativo:
invoke MessageBox, NULL, addr __error_resta, addr __error, MB_OK
invoke ExitProcess, 0
fin:
invoke ExitProcess, 0
end start
